package com.ticketbooking.controller.Test;

import com.ticketbooking.constant.Constant;
import com.ticketbooking.service.IJdbcService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by linzhi on 2017/8/23.
 */
@Controller
@RequestMapping("/test")
public class TestController {
    @Resource
    private IJdbcService jdbcService;

    @RequestMapping("/index")
    public String index() {
        return "index";
    }

    @RequestMapping("/getData")
    public String getData(String condition, Model model) {
        List query = jdbcService.query();
        model.addAttribute(query);
        return Constant.JSON_VIEW_OTHER;
        //将静态字符串之类的放到独立的类里
    }
}
